#pragma once

#include <QObject>
#include<QTimer>
#include<QThread>
#include "ubSiemensPLC.h"

class CReadThread  : public QObject
{
	Q_OBJECT

public:
	CReadThread(QObject *parent= nullptr);
	~CReadThread();

	//write

	void start(int interval);
	void stop() ;
	void set_enable(bool enable);
	bool get_enable();
public slots:

	void threadRun();


private:
	bool m_enable = false;
	QThread* thread;
	QTimer* timer;

	int runNum = 0;
	ubSiemensPLC *m_siemensPLC;
};
